import React from "react";
import { Form, Icon, Input, Button, Checkbox } from 'antd';
import "../style/login.scss"
const FormItem = Form.Item;


class NormalLoginForm extends React.Component {
    constructor(props) {
        super(props);
        this.state={
            login:true
        }

    }
    componentDidMount() {
        document.title="后台管理"
        

    }
    handleSubmit = (e) => {
        e.preventDefault();
        this.props.form.validateFields((err, values) => {
          if (!err) {
            console.log('Received values of form: ', values);
          }
        });
      }
    
    render() {
        const { getFieldDecorator } = this.props.form;
        return (
            <div className="main-container components-form-demo-normal-login" >
                <Form onSubmit={this.handleSubmit} className="login-form" >
                   <div className="title">后台管理</div>
                    <FormItem>
                        {getFieldDecorator('userName', {
                            rules: [{ required: true, message: '请输入您的用户名!' }],
                        })(
                            <Input prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />} placeholder="请输入用户名" />
                        )}
                    </FormItem>
                    <FormItem>
                        {getFieldDecorator('password', {
                            rules: [{ required: true, message: '请输入您的密码!' }],
                        })(
                            <Input prefix={<Icon type="lock" style={{ color: 'rgba(0,0,0,.25)' }} />} type="password" placeholder="请输入密码" />
                        )}
                    </FormItem>
                    <FormItem>
                       
                        <Button type="primary" htmlType="submit" className="login-form-button">
                        登录
                       </Button>
                       
                    </FormItem>
                </Form>
            </div>
        )
    }
}
const WrappedNormalLoginForm = Form.create()(NormalLoginForm);
export default Connect()(WrappedNormalLoginForm);;

